package service.has;

import relations.Has;
import dao.HasDAO;
import dao.RecordDuplicateException;


public class HasServiceInMemory implements HasService {

	public HasServiceInMemory(){
		
	}
	
	public static HasService newInstance(){
		return new HasServiceInMemory();
	}
	
	/**
	 * Finds a customer based on the customer id.
	 * @param userid - user id
	 * @return the instance of the customer
	 */
	public Has findHas(String creditCardNum, String userID){
		HasDAO db = HasDAO.getInstance();
		Has result = null;
		result = db.findHas(creditCardNum, userID);
		return result;
	}
	
	
	/**
	 * Adds a new customer to the system.
	 * @param obj - the customer instance to add
	 */
	
	public void addHas(Has obj) throws RecordDuplicateException{
		HasDAO db = HasDAO.getInstance();	
		db.addHas(obj);
		return;
	}

}
